global keepers1970 ""


numlabel, add

genl yr=1970
global keepers1970 $keepers1970 yr

genl id=v2
global keepers1970 $keepers1970 id

genl income=v23
replace income=v24 if v24~=.
genl income3=income
centile income, c(33 66 100)
replace income3=0 if income<=r(c_1)
centile income, c(33 66 100)
replace income3=1 if income>r(c_1) & income<=r(c_2)
centile income, c(33 66 100)
replace income3=2 if income>r(c_2) & income<=r(c_3)
global keepers1970 $keepers1970 income3

genl pid_ce=(v98==22 & v99==1)
replace pid_ce=. if v97==.
global keepers1970 $keepers1970 pid_ce

genl pid_gov=pid_ce
global keepers1970 $keepers1970 pid_gov

genl vote_ce=v167
recode vote_ce 22=1 .=. else=0
global keepers1970 $keepers1970 vote_ce

genl vote_gov=vote_ce
global keepers1970 $keepers1970 vote_gov


genl gpi=abs(v27-4)/3
global keepers1970 $keepers1970 gpi

genl socref=v95
recode socref 8=3
replace socref=abs(socref-5)/4
global keepers1970 $keepers1970 socref

genl degree=v212
recode degree 7=1 1/6=0 0=.
global keepers1970 $keepers1970 degree


// Class/occupation

gen class_resp_3cat = v180
recode class_resp_3cat 1/7=3 10/25=2 30/40=1
replace class_resp_3cat = . if class_resp_3cat > 40
label variable class_resp_3cat "Social class (3 cats.): higher value is higher class"
*label define LblClassGrade 1 "A: (Higher man.; prof." 2 "B: Lower man.; admin." 3 "C1A: Skilled; supervis. non-manu." 4 "C1B: Lower non-manu." 5 "C2: Skilled manu." 6 "D: Unskilled manu."
*label values class_head_grade LblClassGrade
global keepers1970 $keepers1970 class_resp_3cat

gen class_spou_3cat = v195
recode class_spou_3cat 1/7=3 10/25=2 30/40=1
replace class_spou_3cat = . if class_spou_3cat > 40
label variable class_spou_3cat "Social class (3 cats.): higher value is higher class"
*label define LblClassGrade 1 "A: (Higher man.; prof." 2 "B: Lower man.; admin." 3 "C1A: Skilled; supervis. non-manu." 4 "C1B: Lower non-manu." 5 "C2: Skilled manu." 6 "D: Unskilled manu."
*label values class_head_grade LblClassGrade
global keepers1970 $keepers1970 class_spou_3cat

gen male = v16
recode male 1=1 2=0
global keepers1970 $keepers1970 male

gen married = v19
recode married 1=1 2=1 3=0 4=0 5=0 6=0
global keepers1970 $keepers1970 married

gen unionmem_resp = v185
recode unionmem_resp 1/4=1 5=0
global keepers1970 $keepers1970 unionmem_resp

gen unionmem_spou = v200
recode unionmem_spou 1/4=1 5=0
global keepers1970 $keepers1970 unionmem_spou



// Pascal/SM moderators

   gen party_ID=. 
   replace party_ID=1 if v97==1 & v98==11
   replace party_ID=2 if v97==1 & v98==22
   replace party_ID=3 if v97==1 & v98==33
   replace party_ID=4 if v97==1 & v98==44
  
   replace party_ID=6 if v97==1 & v98==66

   replace party_ID=8 if v97==1 & v98==88
   replace party_ID=9 if v97==1 & v98==12
   replace party_ID=10 if v97==1 & v98==55
 
 lab def party_ID 1 "v�nsterpartiet kom " 2 "socialdemokraterna" 3"centerpartiet" 4"folkpartiet" 5"h�gerpartiet" 6"kristen demokratis" 7 "other" 8 "will not answer"9 " kommunistiska f�rbundet marxist-len" 10 " moderata samlingspartiet " 11 "sveriges kommunis" 12 "borgerligt "  13 "FC+C" 14 "lokal borgerlig" 15 "sk�nepartiet" 16 "kommunistiska arbetaref�rbundet" 17 "vpk, apk, kpmlr, skp, kaf" 18 "gr�nt parti" 19 "ny demokrati"
 lab val party_ID party_ID
  tab party_ID, m
 tab party_ID v98, m
  
    foreach var of varlist v93 v94 v96{
        gen Z`var'=`var'
		replace Z`var'=1 if `var'==5
		replace Z`var'=2 if `var'==4
		replace Z`var'=2.5 if `var'==8
		replace Z`var'=3 if `var'==2
		replace Z`var'=4 if `var'==1
		replace Z`var'=(Z`var'-1)/3
		tab Z`var' `var', m
  }
  
  rename Zv93 tax_cut
  lab var tax_cut "1=agree importance of tax cut"
  
  rename Zv94 state_employment
  lab var state_employment "1=state intervention reduce unemployment risk"
  
  rename Zv96 econ_control
  lab var  econ_control "1=agree state control limit bank and industry influence"
  
  
    gen bank_gov_appointies=.
  replace bank_gov_appointies=1 if v117==1
   replace bank_gov_appointies=0.66 if v117==2
  replace bank_gov_appointies=0.33 if v117==3
  replace bank_gov_appointies=0 if v117==5
  tab bank_gov_appointies v117, m
  
     lab var bank_gov_appointies "1=agree government appointes on bank and enterprises board"
	 
	
	gen imp_winner=.
 replace imp_winner=1 if v28==1
 replace imp_winner=0.5 if v28==3 | v28==8
 replace imp_winner=0 if v28==5
 tab v28 imp_winner, m
 
 lab var imp_winner "1=which party win the election is important"

 
 gen anti_econ_control=.
replace anti_econ_control=0.3333333 if econ_control>0.5 & econ_control<1
replace anti_econ_control=0.6666666 if econ_control>0 & econ_control<0.5
replace anti_econ_control=1 if econ_control==0
replace anti_econ_control=0.5 if econ_control==0.5
replace anti_econ_control=0 if econ_control==1
tab anti_econ_control econ_control, m

gen anti_state_employment=.
replace anti_state_employment=0.3333333 if state_employment>0.5 & state_employment<1
replace anti_state_employment=0.6666666 if state_employment>0 & state_employment<0.5
replace anti_state_employment=1 if state_employment==0
replace anti_state_employment=0.5 if state_employment==0.5
replace anti_state_employment=0 if state_employment==1
tab anti_state_employment state_employment, m

gen anti_bank_gov_appointies=.
replace anti_bank_gov_appointies=0.3333333 if bank_gov_appointies>0.5 & bank_gov_appointies<1
replace anti_bank_gov_appointies=0.6666666 if bank_gov_appointies>0 & bank_gov_appointies<0.5
replace anti_bank_gov_appointies=1 if bank_gov_appointies==0
replace anti_bank_gov_appointies=0.5 if bank_gov_appointies==0.5
replace anti_bank_gov_appointies=0 if bank_gov_appointies==1
tab anti_bank_gov_appointies bank_gov_appointies, m

gen index_interest=( gpi +imp_winner  )/2
global keepers1970 $keepers1970 index_interest

gen index_market_oriented=(anti_bank_gov_appointies +anti_econ_control+ anti_state_employment)/3
global keepers1970 $keepers1970 index_market_oriented
